<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title><?=L('login_title')?></title>
<meta name="robots" content="noindex,nofollow">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="stylesheet" href="<?=Web_Path?>packs/layui/css/layui.css">
<script src="<?=Web_Path?>packs/js/jquery.min.js"></script>
<script src="<?=Web_Path?>packs/js/cscms.js"></script>
<link type="text/css" rel="stylesheet" href="<?=Web_Path?>packs/swfupload/swfupload.css" />
<script type="text/javascript" src="<?=Web_Path?>packs/swfupload/swfupload.js"></script>
<script type="text/javascript">
cscms.get_host();
var swfu;
var len=0;
$(document).ready(function(){
	swfu = new SWFUpload({
		flash_url:"<?=Web_Path?>packs/swfupload/swfupload.swf?"+Math.random(),
		upload_url:"<?=$upsave?>",
		file_post_name : "Filedata",
		post_params:{"dir":"<?=$dir?>","key":"<?=$key?>"},
		file_size_limit:"<?=$size?>",
		file_types:"<?=$types?>",
		file_types_description:"All Files",
		file_upload_limit:"<?=$nums?>",
		file_queue_limit : "0",
		custom_settings : {progressTarget : "fsUploadProgress",cancelButtonId : "btnCancel"},
		debug: false,
		button_image_url: "",
		button_width: 75,
		button_height: 28,
		button_placeholder_id: "buttonPlaceHolder",
		button_text_style: "",
		button_text_top_padding: 3,
		button_text_left_padding: 12,
		button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
		button_cursor: SWFUpload.CURSOR.HAND,

		file_dialog_start_handler : fileDialogStart,
		file_queued_handler : fileQueued,
		file_queue_error_handler:fileQueueError,
		file_dialog_complete_handler:fileDialogComplete,
		upload_progress_handler:uploadProgress,
		upload_error_handler:uploadError,
		upload_success_handler:uploadSuccess,
		upload_complete_handler:uploadComplete
	});
})
function att_show(serverData,file){
	len++;
	var msg = JSON.parse(serverData);
	if(msg['msg']=='ok'){
		parent.cscms.layer.msg('恭喜你，第'+len+'张图片上传成功',{icon:1});
	}else{
		parent.cscms.layer.msg('抱歉上传失败,请刷新重试',{icon:2});
	}
}
</script>
</head>
<body style="padding: 0px 10px">
<div class="layui-tab" lay-filter="demo" style="box-shadow: none">
	<ul class="layui-tab-title" >
		<li class="layui-this">上传文件</li>
	</ul>
	<div class="layui-tab-content">
		<div class="layui-tab-item layui-show" style="padding-bottom: 10px">
			<div id="cnt_0" class="dr_hide">
				<div>
					<div class="addnew" id="addnew">
						<span id="buttonPlaceHolder"></span>
					</div>
					<input type="button" id="btupload" value="开始上传" onClick="swfu.startUpload();" />
					<div id="nameTip" class="onShow">最多上传 <font color="red"><?=$nums?></font> 个文件,单文件最大 <font color="red"><?=ceil($size/1024)?></font> MB</div>
					<div class="bk3"></div>
					<div class="lh24"><?='文件格式：'.str_replace(array(';', '*.'), array('、', ''), $types)?></div>
				</div> 	
				<div class="bk10"></div>
				<fieldset class="blue pad-10" id="swfupload" style="min-height: 60px">
				<legend>文件列表</legend>
				<ul class="attachment-list" id="fsUploadProgress">    
				</ul>
				</fieldset>
			</div>
		</div>
		<div id="att-status" class="hidden"></div>
        <div id="att-status-del" class="hidden"></div>
	</div>
</div>
</body>
</html>

